unit Unit1;

interface

uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,ServerMethodsUnit1,
  Vcl.StdCtrls,ServerContainerUnit1;

type
  TForm1 = class(TForm)
    ButtonStop: TButton;
    ButtonStart: TButton;
    TestButton: TButton;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure ButtonClick(Sender: TObject);
    procedure TestButtonClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.TestButtonClick(Sender: TObject);
var
ServerMethods : TServerMethods1;
s: boolean;
begin
servermethods := TserverMethods1.Create(nil);
s:= servermethods.SaveLockName('3');
if s then
  memo1.Text := 'Locked by someone.'
else
  memo1.Text := 'Can be Ordering.';


end;

procedure TForm1.ButtonClick(Sender: TObject);
begin
   ButtonStop.Enabled := not ButtonStop.Enabled;
   ButtonStart.Enabled := not ButtonStart.Enabled;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin

  if not ServerContainer1.DSServer1.Started then
      ServerContainer1.DSServer1.Start;
   ButtonStop.Enabled := ServerContainer1.DSServer1.Started;
   ButtonStart.Enabled := not ButtonStop.Enabled;

end;


end.

